package com.sx.frame.controller;

import com.sx.frame.common.Result;
import com.sx.frame.domain.vo.UserVO;
import com.sx.frame.service.IUserService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@Slf4j
@RestController
public class UserController {

    @javax.annotation.Resource
    private IUserService userService;

    /**
     * http://localhost:8089/queryUserInfo
     */
    @RequestMapping("queryUserInfo")
    public Result<?> queryUserInfo() {
        log.info("查询用户信息");
        List<UserVO> userVOList = userService.queryUserList();
        return Result.OK(userVOList);
    }
    /**
     * http://localhost:8089/queryUserInfo
     */
    @RequestMapping("queryUserInfo1")
    public Result<?> queryUserInfo(@RequestParam String uId) {
        log.info("查询用户信息");
        List<UserVO> userVOList = userService.queryUserInfo(uId);
        return Result.OK(userVOList);
    }
}
